import unittest
from datetime import datetime
from common.HTMLTestRunnerPlugins import HTMLTestRunner

time = datetime.now()
time_str = time.strftime("%Y_%m_%d-%H_%M_%S")

def runner(path, fileName):
    loader = unittest.defaultTestLoader.discover(path, fileName)
    runnor = HTMLTestRunner(
        open(time_str + "陈丽桦测试.html", "wb"),
        verbosity=2,
        title="登录测试用例",
        description="第一次执行登录测试",
        tester="陈丽桦",
    )
    runnor.run(loader)


runner(r"E:\测试课件\自动化测试项目\ecshop\Script", "*case.py")
